<template>
  <div>
    <p>国内网站：粉丝数量：{{msg | number(10000) }}万 </p>
    <p>外国网站：粉丝数量：{{msg | number(1000)}} 千</p>

    <p>时间：{{time | timer('-')}} </p>
    <p>时间：{{time | timer('/')}} </p>
  </div>
</template>

<script>
export default {
  data () {
    return {
      msg: 1876986,
      time: 1636450540055
    }
  },
  filters: {
    number: function (val, item) {
      return val / item
    },
    timer: function (val, v) {
      const date = new Date(val)
      const y = date.getFullYear()
      const m = (date.getMonth() + 1).toString().padStart(2, 0)
      const d = (date.getDate()).toString().padStart(2, 0)
      return y + v + m + v + d
    }
  }
}
</script>

<style scoped lang='less'>

</style>
